package _220311;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

/**
 * @author ShadowLim
 * @create 2022-03-11-11:15
 */
public class _迷宫 {
    static int[][] dirs = {{1, 0}, {0, -1}, {0, 1}, {-1, 0}};
    static int m = 30;
    static int n = 50;
    static String[] ans = {"D", "L", "R", "U"};
    static String[][] migong = new String[m][n];
    static Queue<Node> d = new LinkedList<Node>();


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < m; i++) {
            migong[i] = scanner.next().split("");
        }
        d.offer(new Node(0, 0, ""));
        migong[0][0] = "#";//表示该节点已经走过了
        bfs();
        scanner.close();
    }

    private static void bfs() {
        int nx, ny;
        while (!d.isEmpty()) {
            Node s = d.poll();
            for (int i = 0; i < dirs.length; i++) {
                nx = s.x + dirs[i][0];
                ny = s.y + dirs[i][1];
                if (nx == 29 && ny == 49) {
                    System.out.println(s.way + ans[i]);
                }
                if (nx >= 0 && nx < m && ny >= 0 && ny < n && "0".equals(migong[nx][ny])) {
                    d.offer(new Node(nx, ny, s.way + ans[i]));
                    migong[nx][ny] = "#";
                }
            }
        }
    }

}

class Node {
    int x, y;
    String way;
    public Node(int x, int y, String way) {
        this.x = x;
        this.y = y;
        this.way = way;
    }
}
